package news.yp.newsproject.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


import java.util.ArrayList;
import java.util.List;

public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> lists = new ArrayList<>();

    public MyFragmentPagerAdapter(FragmentManager fm, List<Fragment> lists) {
        super(fm);
        this.lists= lists;
    }


    @Override
    public Fragment getItem(int i) {
        return lists.get(i);
    }

    @Override
    public int getCount() {
        return lists.size();
    }
}
